/**
 * 代号:隐无为 2017：厚溥
 * 文件名：BaseDao.java
 * 创建人：柯栋
 * 日期：2017年12月21日
 * 修改人：
 * 描述：
 */
package org.kd.websocket;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;

/**
 * 用途：websocket 配置
 */
@Configuration
@EnableWebSocket
public class WebSocketConfig  implements WebSocketConfigurer{

	@Override
	public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
		// websocket
//	    registry.addHandler(myHandler(), "/myHandler");
//	    registry.addHandler(layimChat(), "/layimChat");
		registry.addHandler(layimChat(), "/layimChat");
	    // sockjs 
//	    registry.addHandler(myHandler(), "/sockjs/myHandler").withSockJS();
	}

	@Bean
    public WebSocketHandler layimChat() {
        return new LayimChat();
    }

	
}
